package com.hsylient.mongodb.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
public class Student {

    @Id
    private String id;
    private String name;
    private Integer age;
    private String address;
    @Field(targetType = FieldType.DECIMAL128)
    private BigDecimal salary;
    @Field(targetType = FieldType.DATE_TIME)
    private Date birthday;
    private List<String> hobbies;
}
